package com.quanshu.change.person.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.quanshu.change.person.entity.SeckillGoodsBuyEntity;
import com.quanshu.exchange.R;

import java.util.List;

/**
 * 作者  李哲
 * 创建时间 2018/8/29
 * 邮箱 lizhetongliao@163.com
 * 说明
 **/
public class SeckillGoodsBuyAdapter extends BaseQuickAdapter<SeckillGoodsBuyEntity, BaseViewHolder> {
    public SeckillGoodsBuyAdapter(@Nullable List<SeckillGoodsBuyEntity> data) {
        super(R.layout.item_seckill_goods_get, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SeckillGoodsBuyEntity item) {
        helper.setText(R.id.text1, item.getGoods_name());
        helper.setText(R.id.text2, item.getCreate_time());
        helper.setText(R.id.text5, item.getTickets());
        helper.setText(R.id.text4, "X " + item.getGoods_nums());
        if (item.getPayment_options() == 0) {
            helper.setVisible(R.id.text3,true);
            helper.setVisible(R.id.txt10,false);
            helper.setText(R.id.text3, "¥ " + item.getReal_price());
        } else if (item.getPayment_options() == 3) {
            helper.setVisible(R.id.text3,false);
            helper.setVisible(R.id.txt10,true);
            helper.setText(R.id.txt10, item.getReal_price());
        }
        helper.addOnClickListener(R.id.root_cl);

    }
}
